import React, { Component } from "react";
import "./App.css";
import { Switch, Route, Redirect } from "react-router-dom";
import { Provider } from "mobx-react";
import MobxIndex from "./pages/mobxIndex";
import AppStore from "./mobx/AppStore";
import './decoratorTest/test' // 测试 mobox 的使用方式

export class App extends Component {

  render() {
    return (
      <Provider hbStore={ AppStore }>
        {/* Switch 匹配Route下的path路径，如果有一个满足，则后面的就不继续匹配了 */}
        <Switch>
          <Route path="/mobxIndex" component={MobxIndex}></Route>
          {/* Redirect 如果前面的 path 路径不匹配，则重定向到 to='/login'路径 */}
          <Redirect to="/mobxIndex"></Redirect>
        </Switch>
      </Provider>
    );
  }
}

export default App;
